package com.bestcem.xm.user.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

import java.util.ArrayList;
import java.util.List;

/**
 * CEM行业代码枚举
 *
 * @author yanjishuo <jishuo.yan@idiaoyan.com>
 * @date 2022/5/12 17:57
 */
@Getter
@AllArgsConstructor
@NoArgsConstructor
public enum ApplicantTradeEnum {

    /**
     * CEM行业代码定义
     */
    APPLICANT_TRADE_CLOTHING(1, "服装"),
    APPLICANT_TRADE_HOTEL(2, "酒店"),
    APPLICANT_TRADE_SUPERMARKET(3, "商超"),
    APPLICANT_TRADE_MEDICAL(4, "医疗"),
    APPLICANT_TRADE_ESTATE(5, "地产"),
    APPLICANT_TRADE_AIRLINE(6, "航空"),
    APPLICANT_TRADE_DIET(7, "餐饮"),
    APPLICANT_TRADE_TOURISM(8, "旅游｜文化"),
    APPLICANT_TRADE_RETAIL(9, "零售｜快消"),
    APPLICANT_TRADE_FINANCE(10, "银行｜保险｜金融"),
    APPLICANT_TRADE_VEHICLE(11, "汽车｜交通｜物流"),
    APPLICANT_TRADE_OTHER(12, "其他"),
    APPLICANT_TRADE_SOFTWARE(13, "软件"),
    APPLICANT_TRADE_INTERNET(14, "互联网｜软件｜SaaS"),
    APPLICANT_TRADE_COMMUNICATIONS(15, "通信"),
    APPLICANT_TRADE_COLLEGES(16, "高校"),
    APPLICANT_TRADE_HUMAN_SERVICES(17, "公共事业"),
    APPLICANT_TRADE_HUMAN_CONSULTATION(18, "调研｜咨询｜广告"),
    APPLICANT_TRADE_HUMAN_AD(19, "广告"),
    APPLICANT_TRADE_CARE_BEAUTY(20, "美业"),
    APPLICANT_TRADE_SATISFACTION(21, "满意度频道"),
    APPLICANT_TRADE_PROPERTY(22, "物业"),
    APPLICANT_TRADE_3C(23, "3C｜家电"),
    APPLICANT_TRADE_GAME(24, "游戏"),
    APPLICANT_TRADE_VERSION(25, "版本定价"),
    ;

    private Integer type;

    private String desc;

    /**
     * 通过type获取
     *
     * @param type
     * @return
     */
    public static ApplicantTradeEnum getByType(Integer type) {
        if (type != null) {
            for (ApplicantTradeEnum value : values()) {
                if (value.getType().equals(type)) {
                    return value;
                }
            }
        }
        return null;
    }


    /**
     * 获取type列表
     *
     * @return
     */
    public static List<String> getTypeList() {
        List<String> typeList = new ArrayList<>();
        for (ApplicantTradeEnum value : values()) {
                typeList.add(value.getType().toString());
            }
            return typeList;
    }

}
